package com.diandian.backend.file.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Minio 配置信息
 *
 * @author ruoyi
 */
@Configuration
public class MinioConfig{

    @Value("${oss.minio.accessKey}")
    private String accessKey;

    @Value("${oss.minio.baseUrl}")
    private String baseUrl;

    @Value("${oss.minio.secretKey}")
    private String secretKey;

    @Bean
    public MinioClient getMinioClient(){
        return MinioClient.builder().endpoint(baseUrl).credentials(accessKey, secretKey).build();
    }
}
